# Base image for running chaincode example02
FROM	golang:latest
MAINTAINER  Andy Zhang <zch@cn.ibm.com>

RUN   mkdir -p $GOPATH/src/github.com/hyperledger/ \
    && cd $GOPATH/src/github.com/hyperledger/ \
    && git clone --single-branch -b master --d 1 https://github.com/hyperledger/fabric.git

COPY  src/ $GOPATH/src/github.com/hyperledger/fabric/examples/chaincode/go/hejia 
RUN   cd $GOPATH/src/github.com/hyperledger/fabric/examples/chaincode/go/hejia \
    && go build && cp hejia /
ENV   CORE_CHAINCODE_ID_NAME hejia_0.1
ENV   CORE_PEER_ADDRESS	peer:7051
CMD   ["/hejia"]
